import Vue from 'vue'
import App from './App'
import store from './store/index.js'
import {
	ajax
} from 'common/request.js'
import {
	sToast,
	back,
	open
} from 'common/showToast.js'
import dimg from './components/img/img'
import * as util from './common/index.js';
Vue.component('dimg', dimg)
// import * as moment from 'moment';
Vue.config.productionTip = false
Vue.prototype.$ajax = ajax
Vue.prototype.$back = back
Vue.prototype.$sToast = sToast
Vue.prototype.$open = open
Vue.prototype.$apiUrl = 'http://dhapi.hg8851.cn/';
App.mpType = 'app';

const app = new Vue({
	...App,
		store
})
// 时间戳转 yy-mm-dd
Vue.filter('birtime', value => {
	const date = new Date(value * 1000); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
	const Y = date.getFullYear() + '-';
	const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
	const D = date.getDate()
	return Y + M + D 
})
app.$mount()
